package slap.http.websocket;

import slap.concurrent.EventStream;
import slap.concurrent.Promise;
import slap.mvc.WebSocketHandler;


public abstract class Inbound {

    public final static ThreadLocal<Inbound> current = new ThreadLocal<Inbound>();
    
    public static Inbound current() {
        return current.get();
    }
    
    public WebSocketHandler handler;
    
    public void _received(WebSocketFrame frame) {
    	handler.onMessage(frame);
    }

    public void close() {
    	handler.onClose();
    }

    public abstract boolean isOpen();
}